package com.example.demo_spring.ioc_di.controller;

import com.example.demo_spring.ioc_di.spring.Hello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private Hello mHelloService;

    public HelloController(){
        System.out.println("Constructor: [controller] HelloController");
    }

    @GetMapping("/hello")
    public String hello()
    {
        mHelloService.toCustomer();
        return "hello";
    }
}
